package io.coding.utils;

import jodd.props.Props;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;


/**
 * Created by Administrator on 2014/9/24.
 */
public class JoddProrUtils {
    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(JoddProrUtils.class);
    public final static String OTHER_PROPS="other.props";
    public  static String getValue(String pathName,String colName) throws IOException {
        IoUtiles ioUtiles = new IoUtiles();
        Props p = new Props();
        String filePath = ioUtiles.getPropPath()+"prop/"+OTHER_PROPS;
        int str = filePath.indexOf(":");
        if (str<1){
            filePath = "/"+filePath;
        }
        filePath=java.net.URLDecoder.decode(filePath,"utf-8");
        p.load(new File(filePath));
        String val = p.getValue(colName);
        return val;
    }


}
